﻿@{
    ViewBag.Title = "Categories";
}
@section Menu
{
    @Html.Partial("~/Views/Menu/Entries.cshtml", new ViewDataDictionary())
}
<script type="text/javascript">
    function openUpdateCategoryDialog() {
        //$("#divUpdateCategory").dialog({ modal: true, resizable: false });
        $('#divUpdateCategory').modal('toggle');
        $('#modalUpdateCategory').toggle();
    }
</script>
<div class="buttons">
    @Ajax.ActionLink("Create new", "ActionForm", null, new AjaxOptions { UpdateTargetId = "divUpdateCategory", OnComplete = "openUpdateCategoryDialog" }, 
                     new { @class = "btn btn-primary"  })
</div>
<br />
<br />
<div id="divIndexCategory">
    @Html.Action("Index")
</div>
<div class="modal hide" id="modalUpdateCategory">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" onclick="closeDialogCategory();">
            ×</button>
        <h3>Category</h3>
    </div>
    <div class="modal-body" id="divUpdateCategory">
    </div>
    <div class="modal-footer">
        <a href="#" class="btn btn-primary" id="buttonSave" onclick="$('#submitCategory').click();">Save</a> 
        <a href="#" class="btn" data-dismiss="modal" onclick="closeDialogCategory();">Cancel</a>
    </div>
</div>
